<!DOCTYPE html>
<html lang="zh-hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面重定向中...</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            color: #333;
        }
        .container {
            text-align: center;
            background: white;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            max-width: 400px;
            width: 90%;
        }
        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #C32A31;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .message {
            color: #666;
            font-size: 16px;
            margin-bottom: 10px;
        }
        .url-info {
            color: #999;
            font-size: 12px;
            word-break: break-all;
            margin-top: 10px;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 5px;
        }
        .logo {
            color: #C32A31;
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .manual-link {
            margin-top: 20px;
            display: none;
        }
        .manual-link a {
            color: #C32A31;
            text-decoration: none;
            font-weight: bold;
            padding: 10px 20px;
            border: 2px solid #C32A31;
            border-radius: 5px;
            display: inline-block;
            transition: all 0.3s ease;
        }
        .manual-link a:hover {
            background: #C32A31;
            color: white;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="logo">广州南洋理工职业学院</div>
        <div class="spinner"></div>
        <div class="message">正在重定向到正确页面...</div>
        <div class="url-info" id="urlInfo"></div>
        <div class="manual-link" id="manualLink">
            <p style="color: #666; font-size: 14px;">自动重定向失败，请点击下方链接：</p>
            <a href="#" id="manualLinkBtn">点击这里进入网站</a>
        </div>
    </div>

    <script>
        // 获取当前URL信息
        const currentPath = window.location.pathname;
        const currentSearch = window.location.search;
        const currentHash = window.location.hash;

        // 显示当前URL信息
        document.getElementById('urlInfo').textContent = `原始URL: ${window.location.href}`;

        // 构建新的Hash模式URL
        let newUrl = window.location.origin;

        // 如果路径不是根路径，将其转换为hash路由
        if (currentPath !== '/') {
            newUrl += '/#' + currentPath;
            if (currentSearch) {
                newUrl += currentSearch;
            }
            if (currentHash) {
                newUrl += currentHash;
            }
        } else {
            newUrl += '/';
        }

        console.log('重定向:', window.location.href, '->', newUrl);

        // 设置手动链接
        document.getElementById('manualLinkBtn').href = newUrl;

        // 延迟500ms后重定向，让用户看到重定向信息
        setTimeout(() => {
            window.location.replace(newUrl);
        }, 500);

        // 如果5秒后还没有重定向成功，显示手动链接
        setTimeout(() => {
            document.getElementById('manualLink').style.display = 'block';
        }, 5000);
    </script>
</body>
</html>
